home *** CD-ROM | disk | FTP | other *** search
- Path: news.lpr.carel.fi!usenet
- From: aril@cmt.lpr.mail.carel.fi (Ari Lukumies)
- Newsgroups: comp.lang.c
- Subject: Re: stricmp()
- Date: Thu, 11 Jan 1996 13:02:32 GMT
- Organization: Carelcomp Forest Oy
- Message-ID: <4d325o$kdv@tahko.lpr.carel.fi>
- References: <8213293982604@demosys.gcomm.com>
- NNTP-Posting-Host: renoir.cclahti.carel.fi
- X-Newsreader: Forte Free Agent 1.0.82
-
- jackal@gcomm.com (Jack Alvrus) wrote:
-
-
- >Here's a fun question for ya':
-
- >stricmp() is an ANSI library function, right? So it should exhibit, if
- >not consistent, at least *documented* behavior, right?
-
- >So, is stricmp("a","^") always less than zero or greater than zero, and
- >if neither, is there any documented behavior in this case?
-
- >I ask because '^' is *between* 'A' and 'a' in ASCII. So if stricmp()
- >always compares to upper case letters, stricmp("a","^") is always less
- >than zero. If it always compares to lower case letters,
- >stricmp("a","^") is always *greater* than zero.
-
- >My compiler's reference manual does not say one way or another, but a
- >quick test showed stricmp("a","^") < 0.
-
- >Any comments?
-
- > Jack Alvrus
- > Galacticomm Software Engineer
-
- To my knowledge, stricmp _is_ one of the ANSI functions. However, the
- string comparison functions also depend on locality to correctly
- compare characters. Comparing anything than alphabets, however, is
- implementation-dependant, and as such, information about how it's done
- should be found in your compiler's manuals implementation details
- section.
-
- AriL
-
- All my opinions are mine and mine alone.
-
-